/*
 * 資源
 */
import { getRequest, postRequest } from '/@/lib/axios';

export const menuApi = {
  /**
   * 保存菜单
   */
  saveMenu: (param) => {
    return postRequest('/sys/resource/save', param);
  },

  /**
   * 查询所有菜单列表
   */
  queryMenu: () => {
    return getRequest('/sys/resource/queryAll');
  },

  /**
   * 查询菜单树
   */
  queryMenuTree: () => {
    return getRequest(`/sys/resource/getMenuTree`);
  },
  /**
   * 查询资源树
   */
  getResourceTree: () => {
    return getRequest(`/sys/resource/getResourceTree`);
  },

  /**
   * 获取所有请求路径
   */
  deleteById: (menuId) => {
    return postRequest(`/sys/resource/delete?menuId=${menuId}`);
  },
};
